<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>三栏布局</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        html,body {
            height: 100%;
        }

        body {
            display: flex;
            flex-direction: column;
        }

        .box1,.box3 {
            height: 100px;
            background: gray;
        }

        .box2 {
            flex: 1;
            background: yellow;
        }
    </style>
</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
<div class="box3"></div>
</body>
</html>